package models

import (
	"time"
)

// OrderReview 订单评价表
type OrderReview struct {
	ID                  uint64     `gorm:"primaryKey;autoIncrement;comment:主键ID" json:"id"`
	OrderID             uint64     `gorm:"not null;index;comment:订单ID" json:"order_id"`
	ReviewerID          string     `gorm:"type:varchar(64);not null;index;comment:评价人ID" json:"reviewer_id"`
	RevieweeID          string     `gorm:"type:varchar(64);not null;index;comment:被评价人ID" json:"reviewee_id"`
	ReviewType          int8       `gorm:"type:tinyint;not null;index;comment:评价类型(1-租客评价房东,2-房东评价租客,3-评价房源,4-评价服务)" json:"review_type"`
	OverallRating       int8       `gorm:"type:tinyint;not null;index;comment:总体评分(1-5星)" json:"overall_rating"`
	ServiceRating       int8       `gorm:"type:tinyint;comment:服务评分(1-5星)" json:"service_rating"`
	CommunicationRating int8       `gorm:"type:tinyint;comment:沟通评分(1-5星)" json:"communication_rating"`
	CleanlinessRating   int8       `gorm:"type:tinyint;comment:清洁评分(1-5星)" json:"cleanliness_rating"`
	ValueRating         int8       `gorm:"type:tinyint;comment:性价比评分(1-5星)" json:"value_rating"`
	Content             string     `gorm:"type:text;comment:评价内容" json:"content"`
	Images              string     `gorm:"type:json;comment:评价图片" json:"images"`
	IsAnonymous         int8       `gorm:"type:tinyint;default:0;comment:是否匿名(0-否,1-是)" json:"is_anonymous"`
	Status              int8       `gorm:"type:tinyint;default:1;index;comment:显示状态(0-隐藏,1-显示,2-审核中)" json:"status"`
	ReplyContent        string     `gorm:"type:text;comment:回复内容" json:"reply_content"`
	ReplyAt             *time.Time `gorm:"type:timestamp;comment:回复时间" json:"reply_at"`
	CreatedAt           time.Time  `gorm:"autoCreateTime;comment:创建时间" json:"created_at"`
	UpdatedAt           time.Time  `gorm:"autoUpdateTime;comment:更新时间" json:"updated_at"`
}
